Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel Pint as a linter #100 #364

Closed

Conversation

munyanezaarmel
Copy link
Contributor

Brief summary of the change made

closes:#100

Are there any other side effects of this change that we should be aware of?

Describe how you tested your changes?

Pull Request checklist

Please confirm you have completed any of the necessary steps below.

  • Meaningful Pull Request title and description
  • Changes tested as described above
  • Added appropriate documentation for the change.
  • Created GitHub issues for any relevant followup/future enhancements if appropriate.

.github/workflows/lint.yml Outdated Show resolved Hide resolved
@munyanezaarmel munyanezaarmel force-pushed the ft-laravel-pint-#100 branch 2 times, most recently from 3fbf652 to c74d731 Compare November 21, 2024 15:27
@munyanezaarmel
Copy link
Contributor Author

@dmohns can you please check this

@dmohns
Copy link
Member

dmohns commented Nov 21, 2024

@dmohns can you please check this

Sure, I will follow up with this next week 👌

@dmohns
Copy link
Member

dmohns commented Nov 26, 2024

Hey @munyanezaarmel

apologies for my delayed response here. I will take a look now 🕵️

@dmohns
Copy link
Member

dmohns commented Nov 26, 2024

Hey @munyanezaarmel

so, after reviewing this here are my thoughts. It looks like Laravel Pint is actually just a rule-set to PHP-CS-Fixer plus a small wrapper around it for nicer CLI integration. The exact rule configuration can be seen here: https://github.com/laravel/pint/blob/main/resources/presets/laravel.php

Now, I don't think there is a benefit of adding the tool it self then. I was originally hoping there is some additional rules and checks in there, which PHP-CS-Fixer cannot cover. But this doesn't seem to be the case.

None-the-less... I think some of the conventions that the Laravel rule set I actually like a lot. So there is something to take away from here.

Could you instead please adapt our current PHP-CS-Fixer rule set with the following rules:

        'method_chaining_indentation' => true,
        'braces_position' => [
            'control_structures_opening_brace' => 'same_line',
            'functions_opening_brace' => 'same_line',
            'anonymous_functions_opening_brace' => 'same_line',
            'classes_opening_brace' => 'same_line',
            'anonymous_classes_opening_brace' => 'same_line',
            'allow_single_line_empty_anonymous_classes' => true,
            'allow_single_line_anonymous_functions' => true,
        ],
        'method_argument_space' => [
            'on_multiline' => 'ensure_fully_multiline',
        ],
        'single_line_empty_body' => true,

?

@dmohns
Copy link
Member

dmohns commented Nov 27, 2024

Hey @munyanezaarmel

for changing the rules set of PHP-CS-Fixer, could you do the following:

  1. Create a new branch (please dont use special characters like # in branch names)
  2. Create exactly 2 commits in the branch. First is to update the rule set
  3. Second commit should reformat the entire repo

Then we will merge this PR.

  1. After that please create a new PR to add the commit that reformatted the repo to .git-blame-ignore-revs

@dmohns
Copy link
Member

dmohns commented Nov 27, 2024

Superseded by: #382

@dmohns dmohns closed this Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants